import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppCommonModule } from '@app/shared/common/app-common.module';
import { UtilsModule } from '@shared/utils/utils.module';
import { CountoModule } from 'angular2-counto';
import { ModalModule, TabsModule, TooltipModule, BsDropdownModule, PopoverModule } from 'ngx-bootstrap';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import {
    BsDatepickerModule,
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService
} from 'ngx-bootstrap/datepicker';
import { NgxBootstrapDatePickerConfigService } from 'assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service';
import { TableModule } from 'primeng/table';
import {
    TreeModule,
    DragDropModule,
    ContextMenuModule,
    PaginatorModule,
    InputMaskModule,
    EditorModule,
    AutoCompleteModule,
    FileUploadModule,
    CheckboxModule,
    MultiSelectModule
} from 'primeng/primeng';

import { BaseDataRoutingModule } from './base-data-routing.module';
import { DataItemsComponent } from './data-items/data-items.component';
import { DataItemTreeComponent } from './data-items/dataitem-tree.component';

import { ImageCropperModule } from 'ngx-image-cropper';
import { TextMaskModule } from 'angular2-text-mask';
import { CreateOrEditDataItemModalComponent } from './data-items/create-or-edit-dataitem-modal.component';
import { CreateOrEditDataItemDetailModalComponent } from './data-items/create-or-edit-dataitem-detail-modal.component';
import { DataItemDetailsComponent } from './data-items/dataitem-details.component';

import { TreeTableModule } from 'primeng/treetable';
import { CodeRulesComponent } from './coderule/code-rules.component';
import { CreateOrEditCodeRuleModalComponent } from './coderule/create-or-edit-coderule-modal.component';
import { CreateOrEditUserCardModalComponent } from './user-card/create-or-edit-user-card-modal.component';
import { UserCardsComponent } from './user-card/user-cards.component';
import { CodeItemsComponent } from './code/code-items.component';
import { CodeRulesNumComponent } from './code/code-nrules.component';
import { SystemInfoComponent } from './SystemInfo/systeminfo-code.component';
import { CreateOrEditSystemInfoModalComponent } from './SystemInfo/create-or-edit-systeminfo-modal.component';
import { MeasurementUnitComponent } from './meaturement/measurement.component';
import { CreateOrEditMeasurementUnitModalComponent } from './meaturement/create-or-edit-measurement-modal.component';

NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales();

@NgModule({
    imports: [
        FormsModule,
        CommonModule,
        FileUploadModule,
        ModalModule.forRoot(),
        TabsModule.forRoot(),
        TooltipModule.forRoot(),
        PopoverModule.forRoot(),
        BsDropdownModule.forRoot(),
        BsDatepickerModule.forRoot(),
        BaseDataRoutingModule,
        UtilsModule,
        AppCommonModule,
        TableModule,
        TreeModule,
        DragDropModule,
        ContextMenuModule,
        PaginatorModule,
        //PrimeNgFileUploadModule,
        AutoCompleteModule,
        EditorModule,
        InputMaskModule,
        NgxChartsModule,
        CountoModule,
        TextMaskModule,
        ImageCropperModule,
        CheckboxModule,
        TreeTableModule,
        MultiSelectModule
    ],
    declarations: [
        DataItemsComponent,
        DataItemTreeComponent,
        DataItemDetailsComponent,
        CreateOrEditDataItemModalComponent,
        CreateOrEditDataItemDetailModalComponent,
        CreateOrEditMeasurementUnitModalComponent,
        MeasurementUnitComponent,
        CodeRulesComponent,
        CreateOrEditCodeRuleModalComponent,
        CodeItemsComponent,
        SystemInfoComponent,
        CreateOrEditSystemInfoModalComponent,
        CodeRulesNumComponent,
        UserCardsComponent,
        CreateOrEditUserCardModalComponent,
    ],

    providers: [
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDaterangepickerConfig
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale
        },
        // CostZT_ModelTaskRelServiceProxy 
    ]
})
export class BaseDataModule {}
